package com.example.springmysqldemo.service;

import com.example.springmysqldemo.dao.BookDao;
import com.example.springmysqldemo.entity.Book;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookService {
    @Autowired
    private BookDao bookDao;
    public Book findOne(String id){
        return bookDao.findBookInfo(id);
    }
    public List<Book> findall(){
        return bookDao.findAllBook();
    }
    public String deleteBook(String id){return bookDao.deleteBook(id);}
    public String addUser(String username,String ustatus){
        return bookDao.addBook(username,ustatus);
    }
    public String updateUser(String username,String ustatus,String id){
        return bookDao.editBook(username,ustatus,id);
    }
}
